<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script src="utility.js"></script>
    <script>
        console.log(isNull(null));

        console.log(isUndefined(undefined));

        //        console.log(isUndefined(a));

        console.log('\u1234\u2345*\u1324', reverseString('\u1234\u2345*\u1324'));

        console.log(getUrlParam("_ijt"));

        console.log(getUrlParam2("_ijt"));

        console.log(GetQueryString("_ijt"));

        console.log(GetRequest()["_ijt"]);

        setCookie('uid', "me");

        console.log(readCookie('uid'));

        delCookie('uid');

        console.log(transTime(new Date(1499053797343)));

        var arr = [1, 1, 2, 3, '3'];

        console.log(arr.contains(1), arr.contains("1"));

        console.log(arr.uniquelize());

        arr.each(function (val, index) {
            console.log(index, val);
        });

        var arr2 = [3, 4];
        console.log(arr, arr2, Array.complement(arr, arr2));

        console.log(arr, arr2, Array.intersect(arr, arr2));

        console.log(arr, arr2, Array.minus(arr, arr2), Array.minus(arr2, arr));

        console.log(arr, arr2, Array.union(arr, arr2));

        console.log(myRegExp.trim('  100  '));

        console.log(myRegExp.isPwd("123", 0, 3), myRegExp.isPwd("123123123d", 8, 16));
        console.log(myRegExp.isQQ('80583600'));
        console.log(myRegExp.isPhone('17607160722'));
        console.log(myRegExp.isEmail('80583600@qq.com'));
        console.log(myRegExp.isNumber('100a'));
        console.log(myRegExp.isChinese('baixiaoming'));
        console.log(myRegExp.isChinese('小明'));
        console.log(myRegExp.isPostcode('412345'));
        console.log(myRegExp.isIDcard('42091119940927001X'));
        console.log(myRegExp.isURL('https://www.baidu.com/'));
        console.log(myRegExp.isDate('2017 4/4'));
        console.log(myRegExp.isIP('1.0.0.0'));

        //         checkJSON
        console.log(checkJSON("123"));
        console.log(checkJSON(null));

        //        delay
//        delay(100) // 步骤1
//            .then(function STEP2() {
//                console.log("step 2 (after 100ms)");
//                return delay(200);
//            })
//            .then(function STEP3() {
//                console.log("step 3 (after another 200ms)");
//            })
//            .then(function STEP4() {
//                console.log("step 4 (next Job)");
//                return delay(50);
//            })
//            .then(function STEP5() {
//                console.log("step 5 (after another 50ms)");
//            });
//
//        Promise.race([
//            Promise.observe(
//                foo(), // 试着运行foo()
//                function cleanup(msg) {
//// 在foo()之后清理，即使它没有在超时之前完成
//                }
//            ),
//            timeoutPromise(3000) // 给它3秒钟
//        ]);
        function foo() {
            
        }
        var ajax = function(){

        };
//        var request = Promise.wrap( ajax );

        var arr = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ];
        function fooo(arr) {
            console.log("mychunck--foo");
            console.log(...arr, this);
        }

        myChunck(arr, fooo.bind(foo), 5);

        function testThrottle() {
            console.log("testThrottle");
        }
        window.addEventListener('resize', function () {
            throttle(testThrottle, 100);
        });

    </script>

</body>
</html>